package com.gisuni.sddc.platformManager.dao;

import java.util.List;

import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

import com.gisuni.sddc.platformManager.model.ProjectAttachment;

@IocBean
public class ProjectAttachmentDao {

	@Inject
	private BasicDao basicDao;
	
	
	public void addProjectAttachment(ProjectAttachment projectAttachmen) {
    	   basicDao.save(projectAttachmen);  
	}


	public boolean deleteProjectAttachmentById(String id) {
		Cnd cnd=Cnd.where("id","=",id);
		return basicDao.delete(ProjectAttachment.class, cnd);
	}


	public boolean updateAttachmentDownStatusById(String id, String status) {
		Cnd cnd=Cnd.where("id","=",id);
		ProjectAttachment projectAttachment = basicDao.findByCondition(ProjectAttachment.class, cnd);
		projectAttachment.setDOWNLOADFLAG(status);
		return basicDao.update(projectAttachment);
	}
}
